<?php
/**
Pagina Inicial do projeto de diario online
*/

require_once("main.php");

require_once("MenuPeer.php");
require_once("PostsPeer.php");

//menu
$criteria = new Criteria();
$criteria->addAscendingOrderByColumn(MenuPeer::IDMENU);
$menus = MenuPeer::doSelect($criteria);
$marray = array();
foreach($menus as $menu) {
    $marray[] = $menu->toArray();
}

$pid = $_GET['pid'];
$post = PostsPeer::retrieveByPK($pid);
$post = $post->toArray();

$pagina->assign('menus',$marray);
$pagina->assign('post',$post);

//echo "$<br />";
/*
echo "<pre>";
var_dump ($post);
echo "</pre>";
*/

$pagina->display("comentar.tpl");

?>